import { defineStore } from 'pinia'
const useLoadingCountStore = defineStore('loadingCount', {
  state: () => {
    return {
      loadingCount: 0
    }
  },
  actions: {
    add() {
      this.loadingCount++;
    },
    reduce() {
      this.loadingCount--;
      if(this.loadingCount<0) {
        this.loadingCount = 0;
      }
    },
    clearHandle() {
      this.loadingCount = 0;
    }

  }
})
export default useLoadingCountStore;